<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="utf-8"%>
<%@taglib prefix="s" uri="/struts-tags" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>KCMS</title>
<jsp:include page="../iframecommon.jsp"></jsp:include>

<style>.file-input-wrapper { overflow: hidden; position: relative; cursor: pointer; z-index: 1; }.file-input-wrapper input[type=file], .file-input-wrapper input[type=file]:focus, .file-input-wrapper input[type=file]:hover { position: absolute; top: 0; left: 0; cursor: pointer; opacity: 0; filter: alpha(opacity=0); z-index: 99; outline: 0; }.file-input-name { margin-left: 8px; }</style>

<script type="text/javascript">
function myCheck(){
var inputs = document.getElementsByName('radio');
var isChecked = false;
for (var i = 0, l = inputs.length; i < l; i++) {
    if (inputs[i].checked == true) {
        isChecked = true;
    }
}
if (!isChecked) {
	alert('至少选择一个作业再上传');
	return false;
	}
var docu=document.getElementsByName('doc');
if(docu[0].value==""){
	alert("请上传文件!");
	return false;
}
	return true;
}
</script>
</head>
<body>

<div class="col-lg-2"></div>
<div class="col-lg-8">
<div class="main-box">
<header class="main-box-header clearfix">
<h1>学生作业管理与评分</h1>
</header>
<div class="alert alert-success">
<i class="fa fa-check-circle fa-fw fa-lg"></i>
请先选择需要查看的课程班级
</div>


<div class="alert alert-success">
<i class="fa fa-check-circle fa-fw fa-lg"></i>
请点选需要查看的课程
<form action="assignment_ListAssign" method="post" name="form1">
<s:iterator value="cr" status="cid">
<div class="radio">
<s:if test="chkbox.equals(cid+'@'+csn)">
<input type="radio" name="chkbox" onchange="submit();" value="<s:property value='sn'/>" id="<s:property value='sn'/>" checked="true">
</s:if>
<s:else>
<input type="radio" name="chkbox" onchange="submit();" value="<s:property value='sn'/>" id="<s:property value='sn'/>">
</s:else>
<label for="<s:property value='sn'/>">
<s:property value="cid" />
<s:property value="csn" />
<s:property value="cname" />
<s:property value="description" />
<s:property value="xuefen" />
<s:property value="properties" />
<s:property value="tid" />
<s:property value="week" />
<s:property value="time" />
<s:property value="location" />
</label>
</div>
</s:iterator>
<!-- <input type="submit"/> -->
</form>
</div>





<s:if test="listassign!=null &&listassign.size()>0">
<div class="alert alert-success">
<i class="fa fa-check-circle fa-fw fa-lg"></i>
如需上传成绩，请务必使用本网页上所下载的模板填写后上传提交，二次上传将覆盖已有的记录
</div>
<form action="assignment_uploadScore" method="post" enctype="multipart/form-data" onsubmit="return myCheck();">
<div class="table-responsive">
<table class="table">
<thead>
<tr>
<th ><span>#</span></th>
<th  ><span>课程号</span></th>
<th  ><span>课序号</span></th>
<th  ><span>作业名称</span></th>
<th  ><span>作业详情</span></th>
<th  ><span>过期时间</span></th>
<th  ><span>下载登成绩模板</span></th>
<th  ><span>打包下载作业</span></th>
<th  ><span>删除作业任务</span></th>
</tr>
</thead>
<tbody>


<s:iterator value="listassign" status="assignmentsn">
   <tr>
   	  <td><input type="radio" value=<s:property value="assignmentsn"/> name="radio"/> </td>
      <td><s:property value="cid" /></td>
      <td><s:property value="csn" /></td>
      <td><s:property value="assignmentname" /></td>
	  <td><s:property value="description" /></td>
      <td><s:property value="duetime" /></td>
      <td><a href="assignment_downloadtemplate?assignmentsn=<s:property value='assignmentsn'/>">下载模板</a></td>
      <td><a href="assignment_downloadAssign?assignmentsn=<s:property value='assignmentsn'/>">打包下载作业</a></td>
      <td><a href="assignment_deleteAssign?assignmentsn=<s:property value='assignmentsn'/>">删除该作业任务</a></td>
   </tr>
</s:iterator>







</tbody>
</table>
<hr>
<input type="file" name="doc" class="form-control"/> 
<hr>
<input type="submit" class="btn btn-success" value="为选中作业任务上传分数"/>
</div>
</form>
</s:if>

</body>
</html>
